package com.olclass.web.dao;

import com.olclass.web.domain.User;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

/**
 * FileName: RoleRepository.java
 * Author:   Administrator
 * Date:     2021/3/22 19:52
 * Description:
 */
public interface UserRepository extends CrudRepository<User, String>, JpaSpecificationExecutor<User> {

    @Query("select u from User u where u.id=?1")
    public User findById(String id);

    @Query("select  u from User u where u.username=?1 and u.password=?2 ")
    User findByUsernameAndPwd(String username, String password);
}